package com.pcbly.web.business.depart;
 

import java.util.List;

import com.pcbly.web.bean.system.DepartBean;
import com.pcbly.web.bean.system.DepartChildBean;
import com.pcbly.web.business.BaseServiceImp; 
import com.pcbly.web.persistence.depart.DepartDao;

public class DepartServiceImp extends BaseServiceImp<DepartBean> implements
		DepartService {
	private DepartDao departDao;
	
	public DepartServiceImp(){
		
	}
	public void setDepartDao(DepartDao departDao) {
		this.departDao = departDao;
	}

	@Override
	public void deleteDepartBeanById(String id) throws Exception {
		// TODO Auto-generated method stub
		departDao.removeById(id);
	}

	@Override
	public List<DepartBean> findDepartBeans() throws Exception {
		// TODO Auto-generated method stub
		return departDao.getAll();
	}

	@Override
	public void saveDepartBean(DepartBean bean) throws Exception {
		// TODO Auto-generated method stub
		departDao.saveDepartBean(bean);
	}

	@Override
	public void updateDepartBean(DepartBean bean) throws Exception {
		// TODO Auto-generated method stub
		departDao.saveObject(bean);
	}
	@Override
	public DepartBean getDepartBeanById(String id) throws Exception {
		// TODO Auto-generated method stub
		return departDao.get(DepartBean.class,id);
	}
	@Override
	public List<DepartChildBean> findDepartChildBeansByParentId(String parentId)
			throws Exception {
		// TODO Auto-generated method stub
		return departDao.findDepartChildBeansByParentId(parentId);
	}
	@Override
	public List<DepartBean> findDepartBeansByParentId(String id)
			throws Exception {
		// TODO Auto-generated method stub
		return departDao.findDepartBeansByParentId(id);
	}


}
